import request from '@/utils/request'

export function getRouters() {
    return request({
        url: '/rbac/menu/tree',
        method: 'get'
    })
}

export function findMenu(data) {
    return request({
        url: '/rbac/menu/find',
        method: 'post',
        data
    })
}

export function getMenuTree() {
    return request({
        url: '/rbac/menu/tree',
        method: 'get'
    })
}

export function saveMenu(data) {
    return request({
        url: '/rbac/menu/save',
        method: 'post',
        data
    })
}

export function updateMenu(data) {
    return request({
        url: '/rbac/menu/update',
        method: 'post',
        data
    })
}

export function deleteMenu(menuId) {
    return request({
        url: `/rbac/menu/delete/${menuId}`,
        method: 'delete'
    })
}

export function updateMenuStatus(data) {
    return request({
        url: '/rbac/menu/updateStatus',
        method: 'post',
        data
    })
}
